<template>
	<div class="math">
		<el-select v-model="value" placeholder="请选择" @change="print()" :popper-append-to-body="false">
			<el-option
				v-for="item in options"
				:key="item.value"
				:label="item.label"
				:value="item.value">
			</el-option>
		</el-select>
		<powerFunction v-if="value=='选项1'"></powerFunction>
		<exponentialFunction v-if="value=='选项2'"></exponentialFunction>
		<logarithmicFunction v-if="value=='选项3'"></logarithmicFunction>
		<exponentialRegression v-if="value=='选项4'"></exponentialRegression>
		<polynomialRegression v-if="value=='选项5'"></polynomialRegression>
		<trigonometricFunction v-if="value=='选项6'"></trigonometricFunction>
	</div>
</template>

<script>
	import powerFunction from "../components/math/PowerFunction.vue";
	import exponentialFunction from "../components/math/ExponentialFunction.vue";
	import logarithmicFunction from "../components/math/LogarithmicFunction.vue";
	import exponentialRegression from "../components/math/ExponentialRegression.vue";
	import polynomialRegression from "../components/math/PolynomialRegression.vue";
	import trigonometricFunction from "../components/math/TrigonometricFunction.vue";
	
	export default {
		data() {
			return{
				options: [{
					  value: '选项1',
					  label: '幂函数'
					}, {
					  value: '选项2',
					  label: '指数函数'
					}, {
					  value: '选项3',
					  label: '对数函数'
					}, {
					  value: '选项4',
					  label: '指数回归'
					}, {
					  value: '选项5',
					  label: '多项式回归'
					// }, {
					//   value: '选项6',
					//   label: '三角函数'
					}],
				value: '选项1',
			}
		},
		methods: {
			print(){
				// console.log(this.value);
			}
		},
		components:{
			powerFunction,
			exponentialFunction,
			logarithmicFunction,
			exponentialRegression,
			polynomialRegression,
			trigonometricFunction,
		},
	}
</script>

<style scoped>
	.math{
		width: 100%; 
		text-align: left;
	}
</style>
